home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / recipe.dxr / 00024_Rollover for recipe in quickView and full view.ls < prev    next >
Encoding:
Text File  |  2000-03-23  |  2.1 KB  |  92 lines

  1. property pSpr, pLastLine, pColorizedVersion, pRawIngredients, pRecipe
  2.  
  3. on beginSprite me
  4.   pSpr = sprite(me.spriteNum)
  5.   mRefresh(me)
  6. end
  7.  
  8. on mRefresh me
  9.   pLastLine = 0
  10.   pRecipe = sprite(me.spriteNum - 1)
  11.   if isText(pSpr) then
  12.     pRawIngredients = getRecipeIngredientsByName(pRecipe.member.text)
  13.   else
  14.     exit
  15.   end if
  16.   pSpr.member.RTF = pSpr.member.RTF
  17.   mSetNewColorizedText(me)
  18. end
  19.  
  20. on mSetNewColorizedText me
  21.   pSpr = sprite(me.spriteNum)
  22.   pColorizedVersion = pSpr.member.RTF
  23. end
  24.  
  25. on mouseLeave me
  26.   pLastLine = 0
  27.   refreshOldColorizedText(me)
  28.   tell the stage
  29.     hideToolTip()
  30.   end tell
  31. end
  32.  
  33. on refreshOldColorizedText me
  34.   if (pSpr.member.boxType = #scroll) and (pSpr.member.scrollTop <> 0) then
  35.     lastScroll = pSpr.member.scrollTop
  36.     pSpr.member.RTF = pColorizedVersion
  37.     pSpr.member.scrollTop = lastScroll - 1
  38.     pSpr.member.scrollTop = lastScroll
  39.   else
  40.     pSpr.member.RTF = pColorizedVersion
  41.   end if
  42. end
  43.  
  44. on mouseWithin me
  45.   if paused() then
  46.     exit
  47.   end if
  48.   reply = helpUserWithThisIngredient(pSpr, pRawIngredients)
  49.   X = reply[1]
  50.   ingredient = reply[2]
  51.   if (pLastLine <> X) and not voidp(ingredient) then
  52.     if the activeWindow <> the stage then
  53.       tell the stage
  54.         rollSprite = grabThisIngredient(ingredient, 1)
  55.         if rollSprite > 0 then
  56.           rollSprite = sprite(rollSprite)
  57.           forceToolTip(rollSprite, ingredient, point(rollSprite.left, rollSprite.top + (rollSprite.height / 3)))
  58.         end if
  59.       end tell
  60.     end if
  61.     pLastLine = X
  62.     refreshOldColorizedText(me)
  63.     if X > 0 then
  64.       pSpr.member.line[X].color = red()
  65.     end if
  66.   else
  67.     if (X = 0) and (pLastLine <> 0) then
  68.       pLastLine = 0
  69.       refreshOldColorizedText(me)
  70.       tell the stage
  71.         hideToolTip()
  72.       end tell
  73.     end if
  74.   end if
  75. end
  76.  
  77. on mouseDown
  78.   if paused() then
  79.     exit
  80.   end if
  81.   reply = helpUserWithThisIngredient(pSpr, pRawIngredients)
  82.   X = reply[1]
  83.   ingredient = reply[2]
  84.   if not voidp(ingredient) then
  85.     if the activeWindow <> the stage then
  86.       tell the stage
  87.         grabThisIngredient(ingredient)
  88.       end tell
  89.     end if
  90.   end if
  91. end
  92.